/*
============================================================================
 Name        : BlockCard.h
 Author      : \x{738b}\x{658c}
 Version     :
 Copyright   : \x{76ca}\x{76df}\x{8f6f}\x{4ef6}
 Description : CBlockCard declaration
============================================================================
*/

#ifndef BlockCard_H
#define BlockCard_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "Block.h"
#include "Control.h"

// CLASS DECLARATION

/**
*  CBlockCard
* 
*/

#ifndef	MOBILEMARKET

class CBlockCard : public CBlock
{
public:
	~CBlockCard();

	static CBlockCard* NewL(CBaseBlock* bsBack,const TInt& nType);

	static CBlockCard* NewLC(CBaseBlock* bsBack,const TInt& nType);

	CBlockCard(CBaseBlock* bsBack,const TInt& nType);

private:
	void ConstructL();

public:
	//from CBlock
	void OnDraw(CFbsBitGc& g) const;

	void OnKeyEvent(const TInt& keyCode);

	TBool ReadData(const TDesC8& aData);

	void WriteData(TDes8& aBuf);

	TInt GetDataLength();
	
	TInt16 GetDataType();

	TInt GetIOType();

	TBool MustLogin();
	
	void SizeChanged();
	
	void OnMouseUp(const TPoint& aPt);

	void OnInput(const TDesC8& strInput);

protected:
	void BeforeDraw(CFbsBitGc& g) const;

private:
	void AppendParamall(HBufC8*& aBuf,const TDesC8& aFieldName,const TDesC8& aFieldValue);
	void AppendParama(HBufC8*& aBuf,const TDesC8& aFieldName,const TDesC8& aFieldValue);
	void PackageData();

private:
	TBuf<20> m_strCard;
	TBuf<20> m_strCardPWD;
	TInt m_nCurrent;
	TBuf<32> m_strErrCard;
	TBuf<32> m_strErrPw;

	TInt m_nType;
	RPointerArray<CControl> m_Ctrls;
	CSelectBox* m_selBox;
	CSingleLineTextInput* m_inputCard;
	CSingleLineTextInput* m_inputPwd;

	HBufC8* m_postData;

	TBuf<20> m_strProductCard;
	TBuf<20> m_strProductPWD;
	CSingleLineTextInput* m_ProductCard;
	CSingleLineTextInput* m_ProductPwd;
	TBuf<32> m_tip1;
	TBuf<16> m_tip2;
	TBuf<32> m_tip3;
	CDesCArray* m_vTip1;	
	CDesCArray* m_vTip2;
	CDesCArray* m_vTip3;
};
#endif //#ifndef	MOBILEMARKET

#endif // BlockCard_H
